<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>类</title>
    <script>
        class Tank{
            constructor(color){
                this.color=color
                this.width= "30px"
                this.height="30px"
            }
            fire=function(){
                    console.log("开火");
                }
            move(){
                console.log("移动");
            }
        }
        let tank1 =new Tank("red");
        let tank2 =new Tank("white");
        console.log(tank1);
        tank1.fire();
        tank2.move();
        delete tank1.width;
    </script>
</head>
<body>
    
</body>
</html>